﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace CroCommando
{
    public abstract class GameObject
    {
        protected Texture2D textureImage;
        protected Vector2 position;
        protected Color color;
        protected float rotation;
        protected Vector2 origin;
        protected Vector2 direction;
        protected Vector2 scale;

        protected Point frameSize;
        protected int currentFrame;
        protected Point sheetSize;

        public GameObject(Texture2D textureImage, Vector2 position, Color color, Point frameSize)
        {
            this.textureImage = textureImage;
            this.position = position;
            this.color = color;
            this.origin = new Vector2(frameSize.X / 2, frameSize.Y / 2);
            this.scale = new Vector2(2);
            this.rotation = 0;
            this.frameSize = frameSize;

            this.sheetSize = new Point(textureImage.Width / frameSize.X, textureImage.Height / frameSize.Y);

            this.currentFrame = 0;
        }

        public virtual void Update(GameTime gameTime, Rectangle clientBounds)
        {

        }

        public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(textureImage, position, null, color, rotation, origin, scale, SpriteEffects.None, 0f);
        }
    }
}